﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Charades.Web.Server.Room
{
	using Charades.Web.Server.Round;
	using Charades.Web.Server.User;

	public class Room
	{
		public Room()
		{
			Id = Guid.NewGuid().ToString();
			Name = Id;
			Users = new List<User>();
			Rounds = new ConcurrentBag<Round>();
			Date = DateTime.UtcNow;
		}

		public string Id { get; private set; }
		public string Name { get; private set; }
		public DateTime Date { get; private set; }
		public RoomStatus Status { get; set; }
		public List<User> Users { get; set; }
		public ConcurrentBag<Round> Rounds { get; set; }

		public void AddUser(User user)
		{
			user.Points = 0;
			Users.Add(user);
			user.RoomId = Id;
		}
	}
}